package com.lm56.web.network.mapper;

import com.lm56.common.MyRequestBody;
import com.lm56.web.network.domain.*;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * Created by kelvin on 16/10/24.
 */
public interface LinesMapper {


    /**
     * ���ݹ�˾ID�Ͳ�ѯ������ȡ��˾·���б�
     *
     * @param param
     * @return
     */
    public List<CompanyLine> getCompanyLinesForCompany(MyRequestBody<CompanyLineQueryForm> param);

    /**
     * ���ݹ�˾ID�Ͳ�ѯ������ȡ��˾·���б�
     *
     * @param param
     * @return
     */
    public int getCompanyLinesCount(CompanyLineQueryForm param);

    /**
     * ���ݹ�˾ID�Ͳ�ѯ������ȡ��˾·���б�
     *
     * @param userId
     * @return
     */
    public CompanyLine getCompanyLinesById(long userId, long lineId);

    /**
     * ������·����
     *
     * @param line
     */
    public void insertCompanyLine(CompanyLine line);

    /**
     * ������·�۸�����
     *
     * @param prices
     */
    public void insertCompanyLinePrice(List<CompanyLinePrice> prices);



    /**
     * ����·������
     *
     * @param line
     */
    public void updateCompanyLine(CompanyLine line);

    /**
     * ɾ��·������
     *
     * @param id
     */

    public void deleteCompanyLineById(long id);
    /**
     * ɾ��·�߼۸�����
     *
     * @param lineId
     */

    public void deleteCompanyLinePricedByLineId(long lineId);

    /**
     * ���ݹ�˾ID��ȡ�����б�
     *
     * @param requestBody
     * @return
     */
     List<CompanyNetwork> getNetworks(MyRequestBody<CompanyNetworkQeuryForm> requestBody);


    /**
     * ���ݹ�˾ID��ȡ�����б�
     *
     * @param param
     * @return
     */
     int getNetworkCount(CompanyNetworkQeuryForm param);
    /**
     * ���ݹ�˾ID������ID��ȡָ������
     *
     * @param userId
     * @param networkId
     * @return
     */
     CompanyNetwork getNetworkByNetworkId(@Param("userId") Long userId,@Param("networkId") Long networkId);


    /**
     * ������������
     *
     * @param network
     */
     void insertNetwork(CompanyNetwork network);
    /**
     * ����������ϵ������
     *
     * @param contacts
     */
    public void  insertNetworkContats(List<CompanyNetworkContact> contacts);

    /**
     * ������������
     *
     * @param network
     */
    public void updateNetwork(CompanyNetwork network);

    /**
     * ɾ����������
     *
     * @param id
     */
    void deleteNetworkById(@Param("userId") Long userId ,@Param("networkId")Long networkId);

     void deleteNetworkContactByNetworkId(long networkId);

}
